<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
// 微信支付回调
Route::any('/v1/shop_api/wx/notify_pay', 'v1\OrderController@notify_pay');
Route::any('/v1/shop_api/wx/h5_notify_pay', 'v1\OrderController@h5_notify_pay');
// 前台访问
Route::any('/v1/shop_api/auth/set_visit', 'v1\AuthController@set_visit');
Route::group(['prefix' => 'v1/shop_api','middleware'=>'shop_api'], function ($router) {
	//单图上传
	Route::post('upload/upload_file', 'v1\UploadController@upload_file');
	
	
	//我的
	//小程序登录
	Route::post('auth/login', 'v1\AuthController@login');	
	//获取用户信息
	Route::get('auth/my', 'v1\AuthController@my');	
	//刷新token
	Route::put('auth/refresh', 'v1\AuthController@refresh');
	
	//获取设置信息
	Route::get('auth/set', 'v1\AuthController@set');
	//绑定手机号
	Route::put('auth/send_phone', 'v1\AuthController@send_phone');
	//退出登录
	Route::delete('auth/logout', 'v1\AuthController@logout');
	//商品足迹
	Route::get('auth/get_footprint', 'v1\AuthController@get_footprint');
	//收藏商品
	Route::get('auth/get_collection', 'v1\AuthController@get_collection');		
	//关于我们
	Route::get('auth/get_about_us', 'v1\AuthController@get_about_us');
	//获取省市区
	Route::get('address/get_area', 'v1\AddressController@get_area');	
	//添加地址
	Route::post('address/add_address', 'v1\AddressController@add_address');	
	//我的地址列表
	Route::get('address/get_address_list', 'v1\AddressController@get_address_list');
	//获取编辑地址数据
	Route::get('address/get_address_info', 'v1\AddressController@get_address_info');
	//编辑地址
	Route::put('address/edit_address', 'v1\AddressController@edit_address');	
	//删除收货地址
	Route::delete('address/delete_address', 'v1\AddressController@delete_address');
	//选择默认地址
	Route::put('address/status', 'v1\AddressController@status');
	
	
	
	
	//订单管理
	//订单列表
	Route::get('order/get_order_list', 'v1\OrderController@get_order_list');
	//订单详情
	Route::get('order/get_order_detail', 'v1\OrderController@get_order_detail');
	//取消订单
	Route::put('order/order_cancel', 'v1\OrderController@order_cancel');
	//确认收货
	Route::put('order/order_confirm', 'v1\OrderController@order_confirm');
	//商品评价页
	Route::get('order/get_order_evaluate', 'v1\OrderController@get_order_evaluate');
	//商品评价
	Route::post('order/order_evaluate', 'v1\OrderController@order_evaluate');
	//订单申诉
	Route::post('order/order_complain', 'v1\OrderController@order_complain');
	//微信支付
	Route::post('order/wx_order_pay', 'v1\OrderController@wx_order_pay');
	
	//首页
	//轮播图
	Route::get('index/get_banner', 'v1\IndexController@get_banner');
	//轮播图详情	
	Route::get('index/swiper_detail', 'v1\IndexController@swiper_detail');	
	//直播详情	
	Route::get('index/pic_detail', 'v1\IndexController@pic_detail');
	//往期直播列表	
	Route::get('index/get_live_list', 'v1\IndexController@get_live_list');
	//我的直播收藏	
	Route::get('index/get_my_live_list', 'v1\IndexController@get_my_live_list');
	//直播收藏
	Route::post('index/picture_collection', 'v1\IndexController@picture_collection');	
	//商品列表
	Route::get('index/get_product', 'v1\IndexController@get_product');
	//商品详情
	Route::get('index/get_product_detail', 'v1\IndexController@get_product_detail');
	//商品收藏
	Route::post('index/product_collection', 'v1\IndexController@product_collection');
	//提交订单页
	Route::get('index/get_submit_order', 'v1\IndexController@get_submit_order');
	//提交订单支付
	Route::post('index/submit_order_pay', 'v1\IndexController@submit_order_pay');
	//获取商品小程序码
	Route::post('index/app_code', 'v1\IndexController@app_code');
	
	//分类
	//商品一级分类
	Route::get('category/get_category_one_list', 'v1\CategoryController@get_category_one_list');	
	//商品二级分类
	Route::get('category/get_category_tow_list', 'v1\CategoryController@get_category_tow_list');
	
	
	//加入购物车
	Route::post('cart/add_cart', 'v1\CartController@add_cart');
	//购物车数量
	Route::get('cart/get_cart_sum', 'v1\CartController@get_cart_sum');
	//购物车列表
	Route::get('cart/get_cart_list', 'v1\CartController@get_cart_list');
	//单选
	Route::put('cart/set_cart_status', 'v1\CartController@set_cart_status');
	//全选全不选
	Route::put('cart/set_cart_status_all', 'v1\CartController@set_cart_status_all');
	//购物车减或加
	Route::put('cart/set_cart_subtract', 'v1\CartController@set_cart_subtract');
	//购物车删除
	Route::delete('cart/cart_delete', 'v1\CartController@cart_delete');
	//购物车提交订单页
	Route::get('cart/get_cart_submit_order', 'v1\CartController@get_cart_submit_order');
	//购物车提交订单支付
	Route::post('cart/submit_cart_order_pay', 'v1\CartController@submit_cart_order_pay');
	
	//咨询
	//咨询轮播图
	Route::get('consult/get_consult_banner', 'v1\ConsultController@get_consult_banner');	
	//咨询列表
	Route::get('consult/get_consult', 'v1\ConsultController@get_consult');
	//咨询详情
	Route::get('consult/get_consult_detail', 'v1\ConsultController@get_consult_detail');
	//咨询点赞
	Route::post('consult/set_consult_like', 'v1\ConsultController@set_consult_like');
	//咨询评论
	Route::post('consult/set_consult_evaluate', 'v1\ConsultController@set_consult_evaluate');
	//一级评论列表
	Route::get('consult/get_consult_evaluate_list', 'v1\ConsultController@get_consult_evaluate_list');
	//二级评论列表
	Route::get('consult/get_consult_evaluate_one_list', 'v1\ConsultController@get_consult_evaluate_one_list'); 
});

// 聚合相关接口 
Route::group(['prefix' => 'v1/shop_api'], function ($router) {
	//手机号码归属地
	Route::get('juhe/get_phone', 'v1\JuheController@get_phone');
	//身份证查询
	Route::get('juhe/get_idcard', 'v1\JuheController@get_idcard');
}); 